package test1230pm;

public class Yuan {
    int r ;
    static double pi=3.14;

    public Yuan() {
    }

    public Yuan(int r) {
        this.r = r;
    }

    public int getR() {
        return r;
    }

    public void setR(int r) {
        this.r = r;
    }

    public static double getPi() {
        return pi;
    }

    public static void setPi(double pi) {
        Yuan.pi = pi;
    }

    @Override
    public String toString() {
        return "Yuan{" +
                "r=" + r +
                '}';
    }
    public double m1(){
        return 2*pi*r;
    }
    public double m2(){
        return pi*r*r;
    }

    public static void main(String[] args) {
        Yuan a = new Yuan();
        a.setR(3);
        System.out.println(a.m1());
        System.out.println(a.m2());
        Yuan b = new Yuan(2);
        System.out.println(b.m1());
        System.out.println(b.m2());
    }
}
